<template>
    <div>

        <LeftMenu />






<el-row >
    <el-col  :span="12">
  <el-button>home 组件 </el-button>
  <el-button type="primary">主要按钮</el-button>
  <el-button type="success">成功按钮</el-button>
  <el-button type="info">信息按钮</el-button>
  <el-button type="warning">警告按钮</el-button>
  <el-button type="danger"  @click='logout'>退出</el-button>

  </el-col>
</el-row>






    </div>
</template>

<script>

import   LeftMenu  from '../../components/Layout/LeftMenu'
export default {

    components:{
        LeftMenu
    },
    data() {
        return {

        };
    },
    created() {

    },
    mounted() {

        this.$axios.post('http://ludir.cn/api/react-project-api/index.php/stus/getStus')
        .then(res=>{
            console.log(res)
        })


    },
    methods: {
       
// 退出功能 
// 1  验证 要不要退出 
// 2  如果退出    先清除本地缓存里面的token   然后跳转到login页面  
// 3  准备重新登录 

      logout() {
        this.$confirm('此操作将永久退出, 是否继续?', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(
            
            
            () => {
          this.$message({
            type: 'success',
            message: '退出成功!'
          });

          localStorage.removeItem('Token')
          this.$router.push('/login')



        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
      }
    }

    
};
</script>

<style scoped   lang='css'>

</style>
